<template>
  <div class="draw-rights-temp white-scrollbar" :class="{'white-bg-page': isWhite}">
    <div class="draw-rights-temp-cont">
      <span class="wnd-title" v-if="hasWndTitle">
        <svg-icon :iconClass="$store.getters.appCfg.logo"/>
        {{$store.getters.appCfg.name}}
      </span>
      <div @click="$emit('wndClose')" class="wnd-close" v-if="hasWndCloseBtn">
        <svg-icon iconClass="close2"/>
      </div>
      <div class="draw-rights-content">
        <div class="success-title mb10" v-if="successText">
          <svg-icon iconClass="success"/>
          <span>{{ successText }}</span>
        </div>
        <ul class="set-list mb20 pb10" v-if="setList && setList.length">
          <li v-for="(it,i) in setList" :key="i">{{ it }}</li>
        </ul>
        <div class="important-title mb20" v-if="importantText">
          <p>{{ importantText }}</p>
        </div>
        <div class="important-title mb20" v-if="$slots.important">
          <slot name="important"/>
        </div>
        <div class="important-title important-title_2 mb20 pb10" v-if="$slots.important2">
          <slot name="important2"/>
        </div>
        <equityTabs :data="equityGroups" ref="equityTabs"/>
        <div class="text-center" :style="{'margin-top': $slots.important2?'10px':'0'}">
          <el-button type="primary" size="medium" @click="onBtnClick">{{ btnText }}</el-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import EquityTabs from '@/components/member/equity-tabs.vue'
export default {
  name: 'drawRightsTemp',
  components: {
    EquityTabs
  },
  props: {
    isWhite: {
      type: Boolean,
      default: true
    },
    hasWndTitle: {
      type: Boolean,
      default: true
    },
    hasWndCloseBtn: {
      type: Boolean,
      default: true
    },
    successText: {
      type: String,
      default: ''
    },
    setList: {
      type: Array,
      default () {
        return []
      }
    },
    importantText: {
      type: String,
      default: ''
    },
    equityGroups: {
      type: Array,
      default () {
        return []
      }
    },
    btnText: {
      type: String,
      default: ''
    }
  },
  methods: {
    onBtnClick () {
      const activeName = this.$refs.equityTabs.activeName || 0
      this.$emit('btnClick', this.equityGroups[activeName])
    }
  }
}
</script>
<style lang="scss" scoped>
.draw-rights-temp{
  height: 100vh;
  overflow: auto;
  &-cont{
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
}
.wnd-title{
  position: fixed;
  left: 16px;
  top: 11px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.7);
  line-height: 16px;
  font-size: 12px;
  .svg-icon {
    font-size: 16px;
    margin-right: 5px;
  }
}
.white-bg-page{
  .wnd-title{
    color: #333;
  }
}
.draw-rights-content{
  flex: 1;
  padding: 0 70px;
  overflow: hidden;
}
.success-title{
  text-align: center;
  .svg-icon{
    font-size: 28px;
    vertical-align: -0.25em;
    margin-right: 10px;
  }
  span{
    font-size: 18px;
    font-weight: bold;
    font-family: Microsoft YaHei-Bold, Microsoft YaHei;
  }
}
.set-list{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 14px;
  font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  font-weight: 400;
  color: #666666;
  li{
    margin: 0 10px;
    position: relative;
    padding-left: 14px;
    &::after{
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 6px;
      height: 6px;
      background: #333333;
      border-radius: 8px;
      opacity: 0.5;
    }
  }
}
.important-title{
  text-align: center;
  > p{
    position: relative;
    display: inline-block;
    vertical-align: middle;
    font-size: 18px;
    font-family: Microsoft YaHei-Bold, Microsoft YaHei;
    font-weight: bold;
    color: #D8A04B;
    padding: 0 20px;
    &::before,&::after{
      content: '';
      position: absolute;
      top: 50%;
      left: 0;
      width: 10px;
      height: 1px;
      background: #D8A04B;
    }
    &::after{
      left: unset;
      right: 0;
    }
  }
  &_2{
    font-size: 18px;
    font-family: Microsoft YaHei-Bold, Microsoft YaHei;
    font-weight: bold;
    color: #D8A04B;
  }
}
.el-button--primary{
  width: 158px;
}
</style>
